//
//  ApplyDoctor_FootView.m
//  International_Hospital
//
//  Created by 统杰李 on 16/7/7.
//  Copyright © 2016年 LiYiLin. All rights reserved.
//

#import "ApplyDoctor_FootView.h"

@implementation ApplyDoctor_FootView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

#pragma mark
#pragma mark - 更新UI界面
-(void)setupUI{
    
    //设置填充的模式
    self.distribution = UIStackViewDistributionFillEqually;
    //设置间距
    self.spacing = 10;
    
    [self addChildButton:@"查找医生申请"];
    [self addChildButton:@"自动重新申请"];
}

#pragma mark
#pragma mark - 添加按钮的方法
-(void)addChildButton:(NSString *)titleString{
    
    UIButton *button = [[UIButton alloc] init];
    
    //设置圆角
    button.layer.cornerRadius = 10;
    
    button.layer.masksToBounds = YES;
    
    //设置边界的颜色
    button.layer.borderColor = [UIColor colorWithRed:34/255.0 green:183/255.0 blue:198.0/255 alpha:1].CGColor;
    
    button.layer.borderWidth = 2;
    
    //设置背景颜色
    [button setBackgroundColor:[UIColor whiteColor]];
    
    [button setTitle:titleString forState:(UIControlStateNormal)];
    //居中
    button.titleLabel.textAlignment = NSTextAlignmentCenter;

    [button setTitleColor:[UIColor darkGrayColor] forState:(UIControlStateNormal)];
    
    [self addArrangedSubview:button];
    
}

@end
